<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link rel="stylesheet" href="/css/bootstrap-datetimepicker.min.css" />
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="col-sm-12">
			<div class="ibox">
				<div class="ibox-body">
					<div class="fixed-table-toolbar">
						<div class="columns pull-left col-md-1 nopadding">
                            <select id="oneAgent" name="oneAgent" class="form-control" th:remove="${oneAgents}?none : all">
								<option value="">所有代理</option>
								<option th:each="oneAgent:${oneAgents}" th:value="${oneAgent.agentNumber}" th:text="${oneAgent.merchantsShortName}"></option>
							</select>
							 <select id="oneAgent" name="oneAgent" class="form-control" th:remove="${agentNumber}?none : all">
								<option th:value="${agentNumber}" th:text="${agentNumber}"></option>
							</select>
                        </div>
                        <div class="columns pull-left col-md-1 nopadding">
                            <select id="twoAgent" name="twoAgent" class="form-control" th:remove="${twoAgents}?none : all">
								<option value="">所有代理</option>
								<option th:each="twoAgent:${twoAgents}" th:value="${twoAgent.agentNumber}" th:text="${twoAgent.merchantsShortName}"></option>
							</select>
							<select id="twoAgent" name="twoAgent" class="form-control" th:remove="${oneAgents}?none : all">
								<option value="">所有代理</option>
							</select>
                        </div>
                        <div class="columns pull-left col-md-1 nopadding">
                            <select id="merchNo" name="merchNo" class="form-control" th:remove="${merchants}?none : all">
								<option value="">所有商户</option>
								<option th:each="merchants:${merchants}" th:value="${merchant.merchNo}" th:text="${merchant.merchantsShortName}"></option>
							</select>
							<select id="merchNo" name="merchNo" class="form-control" th:remove="${merchNo}?none : all">
								<option th:value="${merchNo}" th:text="${merchNo}"></option>
							</select>
							<select id="merchNo" name="merchNo" class="form-control" th:remove="${oneAgents}?none : all">
								<option value="">所有商户</option>
							</select>
                        </div>
						<div class="columns pull-left col-md-2 nopadding">
							<input id="orderNo" type="text" class="form-control"
								placeholder="输入订单号">
						</div>
						<div class="columns pull-left col-md-1 nopadding" th:remove="${user}? none : all">
							<select id="payCompany" class="form-control">
								<option value="">所有支付公司</option>
								<option th:each="payCompany:${payCompanys}" th:value="${payCompany.key}" th:text="${payCompany.value}"></option>
							</select>
						</div>
						<div class="columns pull-left col-md-2 nopadding" th:remove="${user}? none : all">
							<select id="payMerch" name="payMerch" class="form-control">
								<option value="">所有支付商户号</option>
							</select>
						</div>
						<!-- <div class="columns pull-left col-md-1 nopadding">
							<select id="outChannel" name="outChannel" class="form-control">
								<option value="">所有支付渠道</option>
								<option th:each="outChannels:${outChannels}" th:value="${outChannels.key}" th:text="${outChannels.value}" th:if="${outChannels.key == 'acp'}"></option>
							</select>
						</div> -->
						<div class="columns pull-left col-md-2 nopadding" th:remove="${user}? none : all">
							<input id="businessNo" type="text" class="form-control"
								placeholder="输入第三方业务单号">
						</div>
						<div class="columns pull-left col-md-1 nopadding">
							<select id="orderState" name="orderState" class="form-control">
								<option value="">所有订单状态</option>
								<option th:each="orderState:${orderStatesSimple}" th:value="${orderState.key}" th:text="${orderState.value}"></option>
							</select>
						</div>
						<div class="columns pull-left col-md-1 nopadding">
							<select id="clearState" name="clearState" class="form-control">
								<option value="">所有清算状态</option>
								<option th:each="clearState:${clearStates}" th:value="${clearState.key}" th:text="${clearState.value}"></option>
							</select>
						</div>
						<div class="columns pull-left col-md-2 nopadding">
							<input id="beginDate"  type="text"  class="form-control form_datetime" style="width:100px;float: left" placeholder="开始时间" title="开始时间" data-date-format="yyyy-MM-dd" data-link-format="yyyy-MM-dd">
							<span style="vertical-align:top;padding: 8px;float: left">-</span>
							<input id="endDate" type="text"  class="form-control form_datetime" style="width:100px; float: left" placeholder="结束时间" title="结束时间" data-date-format="yyyy-MM-dd" data-link-format="yyyy-MM-dd">
						</div>
						<div class="columns pull-left">
							<button class="btn btn-success" onclick="reLoad()">查询</button>
						</div>
						<div style="clear: both;"></div>
					</div>
					<div class="alert alert-success" style="margin: 0px;padding: 5px;" th:if="${userType!=3 and userType!=6}">
                       	 总订单数：<span class="label-success" id="orderSum"> 0 </span>；成功：<span class="label-primary" id="succSum"> 0 </span>；
                       	 失败：<span class="label-danger" id='errSum'> 0 </span>；处理中：<span class="label-info" id="ingSum"> 0 </span>；
                       	 <!-- 通知中：<span class="label-warning" id="noticeErrSum"> 0 </span>； -->
                       	 成功交易额：<span class="label-primary" id="amount"> 0 </span>；成功手续费：<span class="label-warning" id="qhAmount"> 0 </span>；
                       	 处理中交易额：<span class="label-primary" id="amountIng"> 0 </span>；处理中手续费：<span class="label-warning" id="qhAmountIng"> 0 </span>；
                       	 实际支出：<span class="label-success" id="realAmount"> 0 </span>；
                       	 <br/>统计条件：<span id="statiWhere"></span>
                    </div>
					<table id="exampleTable" data-mobile-responsive="true">
					</table>
				</div>
			</div>
		</div>

	<div th:include="include :: footer"></div>
	<script th:inline="javascript">
		/*<![CDATA[*/
		    var outChannels = [[${outChannels}]];
		    var payCompanys = [[${payCompanys}]];
		    var orderStates = [[${orderStates}]];
		    var clearStates = [[${clearStates}]];
		    var cardTypes = [[${cardTypes}]];
		    var acctTypes = [[${acctTypes}]];
		    var orderTypes = [[${orderTypes}]];
		    var merchNos = null;
		    var merchNo = [[${merchNo}]];
			var user = [[${user}]];
			var userTypes = null;
			var userType = [[${userType}]];
			var noticeStates = [[${noticeStates}]];
			var syncOrderFlag = false;
			var noticeOrderFlag = false;
		/*]]>*/
	</script>
	<div th:remove="${user}? none : all">
		<script th:inline="javascript">
			userTypes = [[${userTypes}]];
		</script>
	</div>
	<div shiro:hasPermission="withdraw:syncOrder">
		<script type="text/javascript">
			syncOrderFlag = true;
		</script>
	</div>
	<div shiro:hasPermission="withdraw:noticeOrder">
		<script type="text/javascript">
			noticeOrderFlag = true;
		</script>
	</div>
	<script type="text/javascript" src="/js/bootstrap-datetimepicker.min.js"></script><!-- 日期框 -->
	<script type="text/javascript" src="/js/bootstrap-datetimepicker.zh-CN.js"></script><!-- 日期框 -->
	<script type="text/javascript" src="/js/jquery.selectBoxIt.min.js"></script>
	<script type="text/javascript" src="/js/appjs/pay/comm.js"></script>
	<script type="text/javascript" src="/js/appjs/trademanager/withdraw.js"></script>
</body>
</html>